import request from '@/service/index.js'

export const addNewCoupon = (data) => {
  return request.post('/coupon/add', data, {
    headers: {
      'Content-Type': 'application/json',
    },
  })
}

export const queryCouponList = (keyword, status, page, pageSize) => {
  return request.get('/coupon/list', {
    params: {
      keyword,
      page,
      pageSize,
      status,
    },
  })
}

export const deleteCoupon = (couponId) => {
  return request.delete(`/coupon/delete/${couponId}`)
}

export const updateCoupon = (data) => {
  return request.put(`/coupon/update`, data, {
    headers: {
      'Content-Type': 'application/json',
    },
  })
}
